local sknvim_normal_mode_data = require('sknvim.util').normal_mode_data

local M = {}

function M:set_variables()
    vim.g.loaded_netrw = 1
    vim.g.loaded_netrwPlugin = 1
    vim.opt.termguicolors = true
    vim.g.neo_tree_remove_legacy_commands = 1
end

M.config = {
    default_component_configs = {
        indent = { padding = 1 },
        icon = sknvim_normal_mode_data({
            folder_closed     = "+",
            folder_open       = "-",
            folder_empty      = "0",
            folder_empty_open = "?"
        }),
        git_status = {
            symbols = sknvim_normal_mode_data({
                added     = "+",
                modified  = "*",
                renamed   = "R",
                deleted   = "X",

                unstaged  = "!",
                untracked = "?",
            })
        }
    },
    source_selector = {
        sources = {
            { source = "filesystem", display_name = " Files" },
            { source = "buffers",    display_name = " Buffers" },
            { source = "git_status", display_name = " Git" },
        },
    },
    window = {
        position = "left",
        width = 30,
    },
    filesystem = {
        filtered_items = {
            -- hide_dotfiles = false,
            never_show = {
                ".git"
            }
        }
    }
}

M:set_variables()

M.lazy_def = {
    "https://github.com/nvim-neo-tree/neo-tree.nvim",
    lazy = false,
    branch = "v3.x",
    dependencies = {
        "https://github.com/nvim-lua/plenary.nvim",
        "https://github.com/MunifTanjim/nui.nvim"
    },
    opts = M.config,
    keys = require("sknvim.keybinds").neotree,
    -- event = {"StdinReadPre", "VimEnter"}
}

return M
